package main

import (
	"cybertwin/access/registry"
	"cybertwin/utils/configtools"
	"fmt"
	"github.com/panjf2000/gnet/v2"
	"github.com/panjf2000/gnet/v2/pkg/logging"
)

func main() {
	ss := &registry.RegisterCenter{
		Network:   "tcp",
		Addr:      fmt.Sprintf(":%d", configtools.GlobalConfiguration.GetInt("registry.port")),
		Multicore: configtools.GlobalConfiguration.GetBool("registry.multicore"),
	}
	err := gnet.Run(ss, ss.Network+"://"+ss.Addr, gnet.WithMulticore(ss.Multicore))
	logging.Infof("server exits with error: %v", err)
}
